<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*"%>
<%@ page import="requestInterFace.Handle.userHandle"%>
<%@ page import="xml.response.*"%>
<%@ page import="xml.root"%>
<%@ page import="util.print.printLogCat"%>
<%@ page import="org.sql.table.*"%>
<%@ page import="xml.var"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="requestInterFace.UserInfoInterFace.*"%>
<%@ page import="jqgrid.jqgrid"%>
<%@ page import="org.util.getNewData"%>
<%@ page import="util.check"%>
<%@ include file="../../util/paramPrint.jsp" %>
<%@ page trimDirectiveWhitespaces="true" %> 
<%   

    /*********** jqgrid ******************/
		jqgrid jq=new jqgrid();
		jq.setRows(request.getParameter(jqgrid._rows));
		jq.setSord(request.getParameter(jqgrid._sord));
		jq.setSortname(request.getParameter(jqgrid._sortname));
		jq.setPage(request.getParameter(jqgrid._page));
		jq.setOper(request.getParameter(jqgrid._oper));
		jq.setSearch(request.getParameter(jqgrid._search));
		/*************************************/
		
String Order_ID = request.getParameter("Order_ID");
String Order_Products = request.getParameter("Order_Products");
String Product_Num = request.getParameter("Product_Num");
String Info =request.getParameter("Info");//产品描述
String userType=(String)session.getAttribute("User_Type");
String userID=(String)session.getAttribute("User_ID");
root root=new root();

	if(!check.checkString(Order_ID)){
		root.setStatus("false");
		root.setMsg("订单ID不正确");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
	}
		orderinfo1_1 user=new orderinfo1_1();
		user.addequwhile("Order_ID"," = ",Order_ID);
		
		if(!user.Select()||Float.parseFloat(user.getFieldsStr("Order_Status"))>3){
			root.setStatus("false");
		root.setMsg("订单ID不存在或者订单已发货");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
		}
		
		if(Order_Products!=null&&(!Order_Products.equals(""))){
		user.addequwhile("Order_Products", "=",Order_Products);
			}else{
		root.setStatus("false");
		root.setMsg("请输入正确的产品ID");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
			}
		
		user.addequwhile("Order_Name", "=",orderinfo1_1.getProduct_Order_Name());
		if(Product_Num!=null&&(!Product_Num.equals(""))){
		    if(check.isNumeric(Product_Num)){
			if(Float.parseFloat(Product_Num)<0){
			root.setStatus("false");
		root.setMsg("产品数额不能小于零");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
			}
		    user.setUpdateField("Product_Num",Product_Num);
			}else{
			root.setStatus("false");
		root.setMsg("请输入正确的数值");
		PrintWriter pw = response.getWriter();
		pw.println(root.getXmlString());
		pw.flush();
		return ;
			}
		}
		
		
		if(Info!=null&&(!Info.equals(""))){
		  
		    user.setUpdateField("Info",Info);
		}
		int row=user.updata();
		root.setRecords(""+row);//设置当前查询到的记录数
		if(row>0){
			root.setStatus("true");
			root.setMsg("修改成功");
		}else{
			root.setStatus("false");
			root.setMsg("修改失败");
		}
		//printLogCat.printlnWriter(root.getXmlString());
		String rep=root.getXmlString();
%>
<%=rep%>




